import java.util.HashSet;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-10-20
 * Time: 23:49
 */
public class Solution {
    public boolean containsDuplicate(int[] nums) {
        Set<Integer> set = new HashSet<>();

        boolean flag = false;
        for (int i = 0; i < nums.length; i++) {
            if (set.contains(nums[i])) {
                flag = true;
            }
            set.add(nums[i]);
        }

        return flag;
    }
}
